package com.example.crossborderecommerce.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 产品属性
 *
 * @author Yolanda
 * @since 2024-05-09
 */
@Data
@Accessors(chain = true)
@TableName("product_attribute")
public class ProductAttribute implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("category_id")
    private Integer categoryId;

    @TableField(exist = false)
    private String categoryName;

    @TableField("specification")
    private String specification;

    @TableField("color")
    private String color;

    @TableField("material")
    private String material;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //指定格式
    private LocalDateTime createTime;

    @TableField("admin_id")
    private Integer adminId;

    @TableField(exist = false)
    private String adminName;
}
